<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');  
class Asset {

    private $CI;

    function Asset(){
        $this->CI = & get_instance();
    } 

    private $cmsassets = array(
    'core.css' => 'css',
    '_plugins/jquery-1.6.2.min.js' => 'js'
    );

    private $endasset = array(
    'core.js' => 'js'
    );

    private $dash = array(
    'dash.js' => 'js'
    );

    private $new_form = array(
    '_plugins/tinymce/tiny_mce.js' => 'js',    
    'article/new_form.js' => 'js'
    );

    private $media_form = array(
    '_plugins/tinymce/tiny_mce.js' => 'js',    
    '_plugins/jquery.simplemodal.js' => 'js',
    '_plugins/jquery.idTabs.min.js' => 'js',
    '_plugins/plupload/plupload.full.js' => 'js',
    'article/media_form.js' => 'js',
    'basic.css' => 'css'
    );

    private $preview_form = array(
    'article/preview_form.js' => 'js'
    );            


    function getassets($cur_page, $cur_sub){


        foreach($this->cmsassets as $key=>$value){    
            switch($value){
                case 'css':
                    $this->CI->montenegrin->css($key);
                    break;
                case 'js':
                    $this->CI->montenegrin->js($key);
                    break;
            }
        }

        if(isset($this->{$cur_page})){

            foreach($this->{$cur_page} as $key=>$value){    
                switch($value){
                    case 'css':
                        $this->CI->montenegrin->css($key);
                        break;
                    case 'js':
                        $this->CI->montenegrin->js($key);
                        break;
                }

            }

        }

        foreach($this->endasset as $key=>$value){    
            switch($value){  
                case 'css':
                    $this->CI->montenegrin->css($key);
                    break;
                case 'js':
                    $this->CI->montenegrin->js($key);
                    break;
            }
        }

    }

}